package com.yijiajiao.finance.bean;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @AUTHOR zhaoming@eduspace
 * @CREATE 2017-06-30-14:41
 */
public class BatchPayDetailQuery extends BatchPayDetail {

    @Getter
    private int pageNo;
    @Getter
    private int pageSize;
    @Getter
    @Setter
    private int startRow;
    @Setter
    @Getter
    private Date queryDate;

    public void setPageNo(int pageNo) {
        // 计算开始行
        if (pageNo > 0) {
            this.startRow = (pageNo - 1) * pageSize;
            this.pageNo = pageNo;
        } else {
            this.pageNo = 0;
        }
    }

    public void setPageSize(int pageSize) {
        // 计算开始行
        if (pageSize > 0) {
            this.startRow = (pageNo - 1) * pageSize;
            this.pageSize = pageSize;
        } else {
            this.pageSize = 10;
        }
    }
}
